using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace NetSpider
{
    public static class FileHelper
    {
        public static Stream CreateFile(string filename)
        {
            string folder = Path.GetDirectoryName(filename);
            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }
            return File.Create(filename);
        }

        public static void DeleteFile(string filename)
        {
            if (File.Exists(filename))
            {
                File.Delete(filename);
            }
        }

        public static void RemoveFolder(string folderName)
        {
            if (Directory.Exists(folderName))
            {
                Directory.Delete(folderName, true);
            }

        }
    }
}
